package com.xw.db137.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xw.db137.entity.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2024/12/24
 * @Description: 用户
 * @Version: 1.0
 */
public interface RoleMapper extends BaseMapper<Role> {
    @Select("SELECT r.id,r.`rolename`,r.`description` FROM `userrole` ur,`role` r WHERE ur.roleid=r.`id` AND ur.userid= #{userId}")
    List<Role> selectRoleByUserId(@Param("userId") int userId);
}